package com.xlhj.websocket.controller;

import com.xlhj.websocket.entity.Message;
import org.springframework.messaging.handler.annotation.MessageMapping;
import org.springframework.messaging.handler.annotation.SendTo;
import org.springframework.stereotype.Controller;

/**
 * @Author: lcj
 * @Date: 2020/11/6 11:38
 * @Description: TODO
 * @Version: 0.0.1
 */
@Controller
public class WebSocketController {

    @MessageMapping("/hello")
    @SendTo("/topic/greetings")
    public Message greeting(Message message) throws  Exception {
        return message;
    }
}
